package com.xiaochong.tir.mq.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2018/6/16.
 */
@Configurable
@Component
public class OkexQueenConfig {

    @Bean
    public DirectExchange OkexNodeAPIExchange() {
        return new DirectExchange(ExchangeQueue.Exchange.EX_NODE_API_MQ, true, false);
    }
    @Bean
    public Queue queueKDataOkexAction(){
        return new Queue(OkexMqQueue.QUEUE_DEPTH_OKEX, true);
    }
    @Bean
    public Binding bindingKDataOkexAction(){
        return BindingBuilder.bind(queueKDataOkexAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_DEPTH_OKEX);
    }
}
